{% extends "kadmin/base.html" %}

{% block content %}
  {% for name, redis in redis_info.items %}
    <h2>Redis Instance: {{ name }}</h2>
    {% if redis.down %}
      <h3>Connection Error!</h3>
      <p>There was an error connecting to Redis with:<br/>
      {{ redis.connection }}</p>
    {% else %}
      <h3>Config:</h3>
      <table class="redis-info">
        <tbody>
          {% for item in redis.config %}
            <tr>
              <th id="{{ name }}-{{ item.key|slugify }}">
                {{ item.key }} <a href="#{{ name }}-{{ item.key|slugify }}">¶</a>
              </th>
              <td>{{ item.value|pprint }}</td>
            </tr>
          {% endfor %}
        </tbody>
      </table>
      <h3>Info:</h3>
      <table class="redis-info">
        <tbody>
          {% for item in redis.info %}
            <tr>
              <th id="{{ name }}-{{ item.key|slugify }}">
                {{ item.key }} <a href="#{{ name }}-{{ item.key|slugify }}">¶</a>
              </th>
              <td>{{ item.value|pprint }}</td>
            </tr>
          {% endfor %}
        </tbody>
      </table>
    {% endif %}
  {% endfor %}
{% endblock %}
